#@layout()
#define main()
<h1>房屋租赁管理
</h1>
#include("_search.html")
<div class="table_box">
    <table class="list">
        <tbody>
        <tr>
            <th width="4%" style="text-align:center;">id</th>
            <th width="15%" style="text-align:center;">发布者</th>
            <th width="15%" style="text-align:center;">楼盘名字</th>
            <th width="15%" style="text-align:center;">楼盘位置</th>
            <th width="15%" style="text-align:center;">租赁价格</th>
            <th width="10%" style="text-align:center;">租赁状态</th>
            <th width="8%" style="text-align:center;">租赁者</th>
            #if(session.user.role == 2)
            <th width="20%" style="text-align:center;">操作</th>
            #end
        </tr>

        #for(x : leasePage.getList())
        <tr>
            <td style="text-align:center;">#(x.id)</td>
            <td style="text-align:center;">#(x.publisher)</td>
            <td style="text-align:center;">#(x.housename)</td>
            <td style="text-align:center;">#(x.houselocation)</td>
            <td style="text-align:center;">#(x.price)</td>
            <td style="text-align:center;">
                #if(x.status == 1)
                    未出租
                #else if(x.status == 2)
                    已出租
                #else
                    正在出租
                #end
            </td>
            <td style="text-align:center;">#(x.leaseer)</td>
            #if(session.user.role == 2)
            <td style="text-align:center;">
                #if(x.status != 2)
                &nbsp;&nbsp;<a href="/lease/delete/#(x.id)">删除</a>
                &nbsp;&nbsp;<a href="/lease/deal/#(x.id)">成交</a>
                #end
            </td>
            #end
        </tr>
        #end
        </tbody>
    </table>
    #@paginate(leasePage.pageNumber, leasePage.totalPage, "/lease/")
</div>
#end